def count1(x:int):
    cnt = 0
    while x>0:
        cnt+=x//5
        x//=5
    return cnt

def check(mid:int):
    global k
    cnt = count1(mid)
    if cnt>=k:return True
    else:return False

k = int(input())
l = 1
r = 10**19
while l<r:
    mid = (l+r)>>1
    if check(mid):
        r = mid
    else:
        l = mid+1
if count1(l)==k:
    print(l)
else:
    print(-1)
